<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>RIA Client API - BY 小网</title>
<link href="css/api.css" type="text/css" rel="stylesheet" />
</head>

<body>
  <ins>此文档描述XML对象的相关属性和方法</ins>
  <div class="nav">
    <a href="#XML">XML()</a>
    <a href="#XMLDocument">XMLDocument</a>
    <a href="#createXMLDocument">createXMLDocument()</a>
    <a href="#load">load()</a>
    <a href="#loadXML">loadXML()</a>
    <a href="#selectNodes">selectNodes()</a>
    <a href="#selectSingleNode">selectSingleNode()</a>
    <a href="#toString">toString()</a>
  </div>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">XML构造方法<a name="XML"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>构造函数</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var _xml = new XML();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>构造函数</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var _xml = new XML();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">XMLDocument属性<a name="XMLDocument"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>XML文档对象</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var doc = _xml.XMLDocument;</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>XML文档对象</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var doc = _xml.XMLDocument;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">createXMLDocument方法<a name="createXMLDocument"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>建立一个新的XML文档</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var doc = _xml.createXMLDocument(namespace, root, doctype);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>建立一个新的XML文档</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var doc = _xml.createXMLDocument(null, null, null);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">load方法<a name="load"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>加载XML文档</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var doc = _xml.load(url);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>加载XML文档，引用外部地址</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
slideHandler(_xml.load("slide.xml"));
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">loadXML方法<a name="loadXML"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>加载XML</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var doc = _xml.loadXML(xmlStr);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>加载XML</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var xmlStr = "&lt;root&gt;&lt;message&gt;hello world!&lt;/message&gt;&lt;/root&gt;";
var doc = _xml.loadXML(xmlStr);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">selectNodes方法<a name="selectNodes"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取匹配xpath的节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var nodes = _xml.selectNodes(context, xpathText, namespaceURLMapper);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取匹配xpath的节点，如果没有找到匹配返回null</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var nodes = _xml.selectNodes(xmlDoc, "message", null);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">selectSingleNode方法<a name="selectSingleNode"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取匹配xpath的的第一个节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var nodes = _xml.selectSingleNode(context, xpathText, namespaceURLMapper);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取匹配xpath的的第一个节点，如果没有找到匹配返回null</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var node = _xml.selectSingleNode(xmlDoc, "root", null);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">toString方法<a name="toString"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>将XML文档或节点转成字符串</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var nodes = _xml.toString(node);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>将XML文档或节点转成字符串</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var str = _xml.toString();
或
var str = _xml.toString(node);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
</body>
</html>